import Vue from 'vue'
import Router from 'vue-router'
const Login = () => import('@/components/login/Login')
const Index = () => import('@/components/index/Index')
const chart = () => import('@/components/chart')
const list = () => import('@/components/index/menu/list')
const add = () => import('@/components/index/menu/add')
const role = () => import('@/components/role')
const admin = () => import('@/components/admin')
const classify = () => import('@/components/classify')
const standard = () => import('@/components/standard')
const manage = () => import('@/components/manage')
const member = () => import('@/components/member')
const banner = () => import('@/components/banner')
const seckill = () => import('@/components/seckill')

Vue.use(Router)

export default new Router({
  mode: "history",
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login,
      meta: "login"
    },
    {
      path: '/',
      name: 'Index',
      component: Index,
      meta: "Index",
      children: [
        { path: "", component: chart, meta: "图表" },
        { path: "/index/list", component: list, meta: "菜单" },
        { path: "/index/add", component: add, meta: "添加" },
        { path: "/index/add/:id", component: add, meta: "修改" },
        { path: "/index/role", component: role, meta: "角色" },
        { path: "/index/admin", component: admin, meta: "管理员" },
        { path: "/index/classify", component: classify, meta: "商品分类" },
        { path: "/index/standard", component: standard, meta: "商品规格" },
        { path: "/index/manage", component: manage, meta: "商品管理" },
        { path: "/index/member", component: member, meta: "会员管理" },
        { path: "/index/banner", component: banner, meta: "轮播图管理" },
        { path: "/index/seckill", component: seckill, meta: "秒杀管理" },
      ]
    }
  ]
})
